pkgname=hts-showtime-svn
pkgver=5397
pkgrel=1
pkgdesc="OpenGL based mediaplayer for Linux"
arch=('i686' 'x86_64')
url="http://www.lonelycoder.com/hts/"
license=('GPL3')
depends=(
'libexif' 
'freetype2' 'libxft' 
'libgl' 
'mesa' 'freeglut' 
'alsa-lib' 'alsa-utils' 'alsa-firmware' 'alsa-lib' 'alsa-plugins' 'alsa-oss' 
'pulseaudio' 'pulseaudio-alsa' 
'gtk2' 
'libxss' 
'libxv' 
'libcdio' 
'libcddb' 'libcdaudio' 'cddb_get' 
'openssl' 
'yasm'
)
makedepends=('subversion' 'gzip')

# Note: _svntrunk URL must end with /showtime otherwise the whole
# repository will be checked out, showtime and all
_svntrunk=svn://svn.lonelycoder.com/hts/trunk/showtime
_svnmod=showtime

build() {
  cd ${srcdir}

  if [ -d ${_svnmod}/.svn ]; then
    (cd ${_svnmod} && svn up -r $pkgver)
  else
    svn co ${_svntrunk} --config-dir ./ -r $pkgver
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  rm -rf ${srcdir}/${_svnmod}-build
  cp -r ${_svnmod} ${_svnmod}-build
  cd ${_svnmod}-build



sed -i 's#--disable-ffprobe \\#--disable-ffprobe \\\
            --disable-vaapi \\#' ./support/configure.inc 


  
  #
  # BUILD
  #
  ./configure --prefix=/usr --release --disable-libpulse --disable-vdpau
  make || return 1

  # Install showtime
  install -D -m755 build.linux/showtime ${pkgdir}/usr/bin/showtime || return 1
  
  # Install man page and documents
  install -D -m644 man/showtime.1 ${pkgdir}/usr/share/man/man1/showtime.1 || return 1
  install -D -m644 README ${pkgdir}/usr/share/doc/hts-showtime/README || return 1
  install -D -m644 debian/changelog ${pkgdir}/usr/share/doc/hts-showtime/ChangeLog || return 1
  gzip ${pkgdir}/usr/share/doc/hts-showtime/ChangeLog || return 1
  
  rm -rf ${srcdir}/${_svnmod}-build
}
